
#ifndef _MEMBER_BTREEITEM_H_
#define _MEMBER_BTREEITEM_H_

#include <BPainter>
#include <BFont>
#include <BIcon>
#include <BImage>
#include <BScrollBar>
#include <BTreeItem>
#include <BTreeWidget>
#include "IAlignment.h"

#define item_member(item)		((member_BTreeItem*)((BTreeItem*)item)->_ptr)

namespace BWE
{
	class member_BTreeItem : public IAlignment
	{
	public:
		member_BTreeItem(BTreeItem* treeItem);
		~member_BTreeItem();
		
		void attach(BTreeWidget* treeWidget);
		void detach(BTreeWidget* treeWidget);

		void dirtyTree();

		void freshSize(const BStyle* style, const BFont* font, int indent);
		void adjustRect(const BRect& abRect);
		
		BTreeItem*		boss;
		BTreeWidget*	tree;
		BColor			color;
		Graph			graph;
		BImageHolder	image;
		BIconHolder		icon;
		BWidgetHolder	widget;
		BFontHolder		localFont;
		BImageHolder	arrowImage;
		BSize			iconSize;
		BString			text;
		Form			form;
		bool			expanded;
		bool			selected;
		bool			visible;

		bool			dirty;
		int				indent;
		const BFont*	realFont;
		BSize			sizeHint;
		BRect			arrowArea;
		BRect			arrowRect;
		BRect			rect;

		BTreeItem*				parent;
		BArray<BTreeItemHolder>	children;
	};
}
#endif